#define   _CRT_SECURE_NO_WARNINGS
#include<stdio.h>

int main()
{
	int a = 0;
	int b = 0;
	int score = 0;
	scanf("%d", &a);
	for (b = 0; b < a; b++) {
		score++;
		a--;
	}
	do {
		score %= 10;
	} while (score % 10 != 0);
	printf("%d", score);
	return 0;
}